#define _CRT_SECURE_NO_WARNINGS 1
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
#include<unordered_map>
#include<queue>
#include<stack>

using namespace std;

class Node {
public:
    int val;
    vector<Node*> children;

    Node() {}

    Node(int _val) {
        val = _val;
    }

    Node(int _val, vector<Node*> _children) {
        val = _val;
        children = _children;
    }
};


class Solution {
public:
    vector<vector<int>> levelOrder(Node* root) {
        vector<vector<int>> ret;
        queue<Node*> qt;
        if (root == nullptr) return ret;
        qt.push(root);
        while (qt.size())
        {
            int n = qt.size();
            vector<int> tmp;
            for (int i = 0; i < n; i++)
            {
                Node* temp = qt.front();
                qt.pop();
                tmp.push_back(temp->val);
                for (auto& t : temp->children)
                {
                    if (t != nullptr) qt.push(t);
                }
            }
            ret.push_back(tmp);
        }
        return ret;
    }
};
int main() {
    return 0;
}